home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-serious-
/
programming
/
other
/
whdload
/
install
< prev
next >
Wrap
Text File
|
2000-02-28
|
4KB
|
158 lines
;----------------------------
; Check version and install if newer
; IN: #source-file
; #dest-file
(procedure P_install
(set #sver (getversion #source-file))
(if
(exists #dest-file)
(set #dver (getversion #dest-file))
(set #dver 0)
)
(if
(< #sver #dver)
(abort
"The installation has determinated that the already installed program"
("\"%s\" has a newer version than the program to install." #source-file)
"The current WHDLoad package seems to be outdated. Therefore the"
"installation will be canceled. Please try to get a newer version of"
"the WHDLoad package."
)
)
(set #prompt ("\nNow installing the program\n\n\"%s\" with version %ld.%ld\n\n" (fileonly #source-file) (/ #sver 65536) (BITAND #sver 65535)))
(if
(> #dver 0)
(set #prompt ("%sby overwriting\n\n\"%s\" with version %ld.%ld" #prompt #dest-file (/ #dver 65536) (BITAND #dver 65535)))
(set #prompt ("%sinto the directory\n\n\"%s\"" #prompt (pathonly #dest-file)))
)
(if
(= @user-level 2)
(set #choice
(askbool
(prompt #prompt)
(default 1)
(choices "Install" "Skip")
(help @askbool-help)
)
)
(set #choice 1)
)
(if
(= #choice 1)
(copyfiles
(help @copyfiles-help)
(source #source-file)
(dest (pathonly #dest-file))
(newname (fileonly #dest-file))
)
)
)
;----------------------------
(if
(exists "C/InstallBB")
(set #mode "dev")
(set #mode "usr")
)
(if
(= #mode "dev")
(welcome
"Welcome to the WHDLoad installation.\n"
"This script will copy all files which need a special location to their recommend places.\n"
"All other files like the source examples and the Install Templates will not copied."
"Therefore it is recommend to move this drawer yourself to your prefered location.\n"
"If you don't want to install all provided programs, please select the expert mode where you can skip these."
)
(welcome
"Welcome to the WHDLoad installation."
)
)
(set @default-dest
(askdir
(prompt "Where should WHDLoad and the other tools installed ?\nThe location must be reachable via the path !\nRecommend is \"C:\".")
(help @askdir-help)
(default "C:")
(disk)
)
)
(set #path "C")
(foreach #path "#?"
(set #source-file (tackon #path @each-name))
(set #dest-file (tackon @default-dest @each-name))
(P_install)
)
(if
(= #mode "dev")
(
(set #dest
(askdir
(prompt "Where should the include files installed ?")
(help @askdir-help)
(default "Includes:")
)
)
(set #path "include")
(foreach #path "#?"
(copyfiles
(help @copyfiles-help)
(source (tackon #path @each-name))
(dest #dest)
)
)
(set #dest
(askdir
(prompt "Where should the autodoc file installed ?")
(help @askdir-help)
(default "Autodocs:")
)
)
(copyfiles
(help @copyfiles-help)
(source "autodoc/whdload.doc")
(dest #dest)
)
(exit
"\n"
"Installation is complete.\n"
"\n"
"All files which need a special location has been copied.\n"
"Please move all other files yourself to your prefered place.\n"
"\n"
"Hope WHDLoad and the tools will be useful for you.\n"
"\n"
"Bye Bert."
(quiet)
)
)
(
(set #dest
(askdir
(prompt "Where should the documentation for WHDLoad installed ?\nA drawer WHDLoad will be created there.")
(help @askdir-help)
(default "Help:")
)
)
(copyfiles
(help @copyfiles-help)
(source "Docs")
(dest (tackon #dest "WHDLoad"))
(all)
(infos)
)
(exit
"\n"
"Installation is now complete.\n"
"Please read the documentation carefully on how to use and configure WHDLoad for your needs."
(quiet)
)
)
)